Skip to content

Conversation

@mabruzzo
Copy link
Collaborator

To be reviewed after #476 has been merged


This PR updates the experimental ratequery api so that it can:

  1. be used to query arrays of doubles or arrays of strings. The internal PointerUnion type was introduced to help make this work nicely
  2. be used to query buffers that Grackle uses in its calculations (this was already supported) and to query arrays of information that is not directly used during Grackle calculations, but may be useful for Grackle users to use.1

To help implement this machinery, I also introduced the SimpleVec type since the basic bookkeeping of growable lists was getting a little out of hand (frankly, I think it would probably be better to just use std::vector for this purpose, but I have left that debate for the future).

I also needed to modify the accessible properties to check both (i) the type of entry and (ii) whether the entry is mutable. Obviously, I also had to introduce a function to read strings.


Overall, I'm not thrilled with how complex the ratequery logic has gotten. I do have some ideas for simplifying things... (I actually added a bunch of notes to the docstring). But, I think requires developing other parts of the API. So, for the near -ish term, I think it's a useful crutch.

Note

This PR doesn't actually introduce any entries to actually leverage this new functionality. That will be the subject of the next PR in this sequence

Footnotes

  1. Lists of strings will commonly fall into this category. But as another example, consider the yields of metal nuclides for each injection pathways. Yes, right now we use these yields in make_consistent. But, in the near future, we expect that to change, and we will simply enforce that the abundances at the start and end of a timestep are consistent. When we make this change, we will want to make the assumed abundances available to users in case external simulation codes want to achieve better consistency with the injection models

For context, the gmock library is a component of googletest (it's
already being installed). All this commit does is make it possible for
us to use it in subsequent PRs
This change ensures that the chemistry_data extension type will provide
a consistent set of attributes, even if we make unused rate information
inaccessible through the ratequery interface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant